home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.0 / Video Toaster v4.0.iso / arexx / cg / rmword.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-11  |  2KB  |  69 lines

  1. /* RmWord -- Delete a word from the Dictionary File */
  2. /* By Bob Caron ©1995 NewTek, Inc.                  */
  3.  
  4. call addlib(CG_AREXX,0)
  5.  
  6. call pragma(d,"rexx:CG/SpellCheck_Support")
  7.  
  8. if exists(words)=0 then do
  9.    call req_tell("Error! wordfile is missing.")
  10.    if exists(words.bu) then
  11.       if req_ask("Use backup word file?") then
  12.          address command "copy words.bu words"
  13.    if exists(words)=0 then do
  14.       call req_tell("Backup file is also missing!","Replace 'rexx:cg/spellcheck_support/words'")
  15.       __QUIT
  16.       call req_bar("ToasterCG")
  17.       call remlib(CG_AREXX)
  18.       exit
  19.       end
  20.    end
  21.  
  22. word=req_string("Word To Delete:")
  23.  
  24. if word="" then do
  25.    call REQ_TELL("Canceled!")
  26.    call req_bar("ToasterCG")
  27.    call remlib(CG_AREXX)
  28.    exit
  29.    end
  30.  
  31. if req_ask("Delete "word" from","Dictionary File?")=0 then do
  32.    call REQ_TELL("Canceled!")
  33.    call req_bar("ToasterCG")
  34.    call remlib(CG_AREXX)
  35.    exit
  36.    end
  37.  
  38.    call rmword(word)
  39.    call req_tell(word||" removed.")
  40.    call req_bar("ToasterCG")
  41.    call remlib(CG_AREXX)
  42.  
  43. exit
  44.  
  45. rmword:
  46.  parse arg word
  47.  call req_bar("Removing Word")
  48.  call pragma(d,"rexx:CG/SpellCheck_Support")
  49.  if exists('rexx:cg/spellcheck_support/rmword')=0 then do
  50.     req_tell("AddWord Program Missing!","It needs to be in 'Rexx/cg/Spellcheck_support'")
  51.     call req_bar("ToasterCG")
  52.     return
  53.     end
  54.  address command "delete words.bu2"
  55.  address command "rename Toaster:Arexx/cg/spellcheck_support/words.bu Toaster:Arexx/cg/spellcheck_support/words.bu2"
  56.  address command "rename Toaster:Arexx/cg/spellcheck_support/words Toaster:Arexx/cg/spellcheck_support/words.bu"
  57.  address command "rmword Toaster:Arexx/cg/spellcheck_support/words.bu Toaster:Arexx/cg/spellcheck_support/new_words "||word
  58.  if exists("Toaster:Arexx/cg/spellcheck_support/new_words") then do
  59.     address command "rename Toaster:Arexx/cg/spellcheck_support/new_words Toaster:Arexx/cg/spellcheck_support/words"
  60.     address command "delete Toaster:Arexx/cg/spellcheck_support/word_temp"
  61.     address command "delete Toaster:Arexx/cg/spellcheck_support/word_temp.srt"
  62.     end
  63.  else
  64.     call req_tell("Error! Creating new Wordfile")
  65. return
  66.  
  67.  
  68. /* $VER:Rmword V1.5 2-14-95 <Cheatah's Never Prosper!>
  69. */